#!/bin/bash

help() {
  echo "Usage:"
  echo "  zmachine network"
  echo ""
}

dependencies_check() {
  sudo which nethogs >>/dev/null 2>&1
  if [ "$?" != "0" ]; then
    pm install -yy nethogs
  fi
}

core() {
  if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    help
    exit 0
  fi

  dependencies_check

  sudo nethogs $@
}

run() {
  core $@
}

run $@
